﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace EAF.Core.DataConnections
{
    public class DataBinder
    {
        public static void Eval(Type t, System.Windows.Forms.Form f)
        {
            Attribute[] attrs = Attribute.GetCustomAttributes(t);
            foreach (Attribute attr in attrs)
            {
                if (attr is SqlSource)
                {
                    SqlSource theSource = (SqlSource)attr;
                    // Create an instance of the basic data access class
                    DAL.Basic.accesDonnees myAccess = new EAF.DAL.Basic.accesDonnees(theSource.ConnectionString);
                    MemberInfo[] members = t.GetMembers();
                    foreach (MemberInfo mi in members)
                    {
                        if (mi.MemberType == MemberTypes.Property)
                        {
                            Attribute[] miAttrs =(Attribute[]) mi.GetCustomAttributes(false);

                        }
                    }

                }
            }

        }
    }
}
